// To parse this data:
//
//   import { Convert, CommonReturn } from "./file";
//
//   const commonReturn = Convert.toCommonReturn(json);
//
// These functions will throw an error if the JSON doesn't
// match the expected interface, even if the JSON is valid.

export interface CommonReturn {
    data:         { [key: string]: any };
    errorMessage: string;
    successFlag:  number;
}

// Converts JSON strings to/from your types
// and asserts the results of JSON.parse at runtime
export class ConvertCommonReturn {
    public static toCommonReturn(json: Object): CommonReturn {
        const temp = JSON.stringify(json) 
        return JSON.parse(temp)
    }

    public static commonReturnToJson(value: CommonReturn): string {
        return JSON.stringify(value);
    }
}
